<?php

defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Admin controller for the users module
 *
 * @author 		Phil Sturgeon - PyroCMS Dev Team
 * @package 	PyroCMS
 * @subpackage 	Users module
 * @category	Modules
 */
class Admin extends UserStore_Controller {

    /**
     * Constructor method
     * @access public
     * @return void
     */
    public function __construct() {
        // Call the parent's constructor method
        parent::__construct();
        $this->load->library('categories_lib');
        $this->load->model('users/users_m');
    }

    function manage($user_name) {
        $profile = $this->users_m->get(array('username' => $user_name));
        $this->data['shop_name'] = $user_name;
        if (count($profile) == 0)
            show_404();

        if ($profile->estore_id == 0)
            show_404();

        $this->template
                ->title('ESTORE_ADMIN')
                ->set_hook('TOOLBAR', 'toolbar_test1')
                ->build('admin/manage', array('profile' => $profile));
    }

}